class Solution(object):
    def uniquePaths(self, m, n):
        """
        :type m: int
        :type n: int
        :rtype: int
        """
        #ans = [[0 for c in range(m)] for r in range(n)]
        dp = [[1]*n]
        for i in range(1, m):
            dp.append([1])
        for i in range(1, m):
            for j in range(1, n):
                dp[i].append(dp[i-1][j]+dp[i][j-1])
        return dp[m-1][n-1]

test = Solution()
print(test.uniquePaths(7, 3))
